﻿<?php
$bdd = new PDO('mysql:host=localhost;dbname=brin_de_soleil_chris', 'root', '');
$req = $bdd->prepare('INSERT INTO prospect(matricule, date_creation, qualite, num_poste, region, departement, classification, num_salaries, nb_particip_concerne, potentiel_particip, nb_brochure, date_hiver, date_inscription_hiver, date_ete, date_inscription_ete, fonctionnement_collect) 
VALUES(:matricule, :date, :qualite, :numposte, :region, :dept, :classification, :nbsal, :nbpartconcerne, :potentielpart, :nbbrochures, :datehiver, :dateinscr_hiver, :dateete, :dateinscr_ete, :facturation_area)');
$req->execute(array(
	'matricule' => $_POST['matricule'],
	'date' => $_POST['date'],
	'qualite' => $_POST['qualite'],
	'numposte' => $_POST['numposte'],
	'region' => $_POST['region'],
	'dept' => $_POST['dept'],
	'classification' => $_POST['classification'],
	'nbsal' => $_POST['nbsal'],
	'nbpartconcerne' => $_POST['nbpartconcerne'],
	'potentielpart' => $_POST['potentielpart'],
	'nbbrochures' => $_POST['nbbrochures'],
	'datehiver' => $_POST['datehiver'],
	'dateinscr_hiver' => $_POST['dateinscr_hiver'],
	'dateete' => $_POST['dateete'],
	'dateinscr_ete' => $_POST['dateinscr_ete'],
	'facturation_area' => $_POST['facturation_area'],
	));
	
	

$req = $bdd->prepare('INSERT INTO etablissement(nom_etablissement) VALUES(:etablissement)');
$req->execute(array(
	'etablissement' => $_POST['etablissement'],
	));
$req = $bdd->prepare('INSERT INTO ville(nom) VALUES(:ville_prospect)');
$req->execute(array(
	'ville_prospect' => $_POST['ville_prospect'],
	));
$req = $bdd->prepare('INSERT INTO adresse(rue, codepostal) VALUES(:adresse, :codepostal)');
$req->execute(array(
	'adresse' => $_POST['adresse'],
	'codepostal' => $_POST['codepostal'],
	));

$req = $bdd->prepare('INSERT INTO coordonnee(telephone1, telephone2, fax, mail) VALUES(:tel1, :tel2, :fax, :email)');	
$req->execute(array(
	'tel1' => $_POST['tel1'],
	'tel2' => $_POST['tel2'],
	'fax' => $_POST['fax'],
	'email' => $_POST['email'],
	));

	
?>